package com.example.homework8.bean;


import com.example.homework8.R;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

public class MoneyInfo {
    public long rowid; // 行号
    public String name; // 名称
    public int current; // 描述
    public String cate; // 分类
    public String createtime; // 价格
    public String username; // 用户名称


    public MoneyInfo() {
        rowid = 0L;
        name = "";
        current = 0;
        cate = "";
        SimpleDateFormat ft = new SimpleDateFormat ("yyyy-MM-dd hh:mm:ss");
        createtime =   ft.format(new Date());
    }

    @Override
    public String toString() {
        return "RecordInfo{" +
                "rowid=" + rowid +
                ", name='" + name + '\'' +
                ", info='" + current + '\'' +
                ", cate='" + cate + '\'' +
                ", createtime='" + createtime + '\'' +
                ", username='" + username + '\'' +
                '}';
    }

    // 声明一个商品的名称数组
    private static String[] mNameArray = {
            "收入2000",
            "买鞋",
            "买包包",
            "出行",
            "教育",
            "保险",
            "零食",
            "生活费"
    };
    // 声明一个商品的名称数组
    private static  String defaultusername =  "user1";
    // 声明一个商品的描述数组
    private static int[] currentArray = new int[]{
        2000,-200,-500,-300,-100,-30,-50,-400
    };

    //  mPicArray
    private static String[] cateArray = {
            "工资", "买鞋",
            "买包包",
            "出行",
            "教育",
            "保险",
            "零食",
            "生活费"
    };
    public static ArrayList<MoneyInfo> getDefaultList(String defname) {
        ArrayList<MoneyInfo> RecordList = new ArrayList<MoneyInfo>();
        for (int i = 0; i < mNameArray.length; i++) {
            MoneyInfo info = new MoneyInfo();
            info.name = mNameArray[i];
            info.current = currentArray[i];
            info.cate = cateArray[i];
            info.username = defname;
            RecordList.add(info);
        }
        return RecordList;
    }
}